package com.ruoyi.warehouse.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.warehouse.mapper.WWarehouseFeeAccountMapper;
import com.ruoyi.warehouse.domain.WWarehouseFeeAccount;
import com.ruoyi.warehouse.service.IWWarehouseFeeAccountService;

/**
 * 仓储记账Service业务层处理
 * 
 * @author wzy
 * @date 2024-08-28 11:25:24
 */
@Service
public class WWarehouseFeeAccountServiceImpl implements IWWarehouseFeeAccountService 
{
    @Autowired
    private WWarehouseFeeAccountMapper wWarehouseFeeAccountMapper;

    /**
     * 查询仓储记账
     * 
     * @param warehouseFeeAccountId 仓储记账主键
     * @return 仓储记账
     */
    @Override
    public WWarehouseFeeAccount selectWWarehouseFeeAccountByWarehouseFeeAccountId(Long warehouseFeeAccountId)
    {
        return wWarehouseFeeAccountMapper.selectWWarehouseFeeAccountByWarehouseFeeAccountId(warehouseFeeAccountId);
    }

    /**
     * 查询仓储记账列表
     * 
     * @param wWarehouseFeeAccount 仓储记账
     * @return 仓储记账
     */
    @Override
    public List<WWarehouseFeeAccount> selectWWarehouseFeeAccountList(WWarehouseFeeAccount wWarehouseFeeAccount)
    {
        return wWarehouseFeeAccountMapper.selectWWarehouseFeeAccountList(wWarehouseFeeAccount);
    }

    /**
     * 新增仓储记账
     * 
     * @param wWarehouseFeeAccount 仓储记账
     * @return 结果
     */
    @Override
    public int insertWWarehouseFeeAccount(WWarehouseFeeAccount wWarehouseFeeAccount)
    {
        wWarehouseFeeAccount.setCreateTime(DateUtils.getNowDate());
        return wWarehouseFeeAccountMapper.insertWWarehouseFeeAccount(wWarehouseFeeAccount);
    }

    /**
     * 修改仓储记账
     * 
     * @param wWarehouseFeeAccount 仓储记账
     * @return 结果
     */
    @Override
    public int updateWWarehouseFeeAccount(WWarehouseFeeAccount wWarehouseFeeAccount)
    {
        wWarehouseFeeAccount.setUpdateTime(DateUtils.getNowDate());
        return wWarehouseFeeAccountMapper.updateWWarehouseFeeAccount(wWarehouseFeeAccount);
    }

    /**
     * 批量删除仓储记账
     * 
     * @param warehouseFeeAccountIds 需要删除的仓储记账主键
     * @return 结果
     */
    @Override
    public int deleteWWarehouseFeeAccountByWarehouseFeeAccountIds(Long[] warehouseFeeAccountIds)
    {
        return wWarehouseFeeAccountMapper.deleteWWarehouseFeeAccountByWarehouseFeeAccountIds(warehouseFeeAccountIds);
    }

    /**
     * 删除仓储记账信息
     * 
     * @param warehouseFeeAccountId 仓储记账主键
     * @return 结果
     */
    @Override
    public int deleteWWarehouseFeeAccountByWarehouseFeeAccountId(Long warehouseFeeAccountId)
    {
        return wWarehouseFeeAccountMapper.deleteWWarehouseFeeAccountByWarehouseFeeAccountId(warehouseFeeAccountId);
    }

    /**
     * 删除仓储记账信息
     *
     * @param warehouseFeeAccountNumber 仓储记账主键
     * @return 结果
     */
    @Override
    public int deleteWWarehouseFeeAccountByWarehouseFeeAccountNumber(String warehouseFeeAccountNumber)
    {
        return wWarehouseFeeAccountMapper.deleteWWarehouseFeeAccountByWarehouseFeeAccountNumber(warehouseFeeAccountNumber);
    }

    /**
     * 重算仓储记账信息
     *
     * @param exitWarehouseNumber 出库单号
     * @return 结果
     */
    @Override
    public int recalculateWWarehouseFeeAccountByExitWarehouseNumber(String exitWarehouseNumber)
    {
        return wWarehouseFeeAccountMapper.recalculateWWarehouseFeeAccountByExitWarehouseNumber(exitWarehouseNumber);
    }
}
